import React from 'react'
import {create } from 'dva-core'
import {Provider,connect} from 'react-redux'

export default function(options) {
    const app = create(options);
    if(!global.registerde) options.models.forEach(model => {
        app.model(model);
    });
    app.start();

    const store = app._store;

    app.start = container => () => <Provider store={store}>{container}</Provider>
    app.getStore = () => store;

    return app;
}